<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iChart.Scale-Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<link rel="stylesheet" href="../resources/style.css" type="text/css"/>

</head>
<body class='ichartjs_page'>
<div class='ichartjs_p_5'><div class='ichartjs_title ichartjs_radius2 ichartjs_p_5'><div class='ichartjs_inline ichartjs_left'>概览&nbsp;&nbsp;</div><a class='ichartjs_anchor' href='#configs'>配置项</a><a class='ichartjs_anchor' href='#events'>事件</a><a class='ichartjs_anchor' href='#methods'>方法</a></div><div class='ichartjs_overview_content'>
<span class='ichartjs_class'>Scale</span>&nbsp;&nbsp;<br/><div class='ichartjs_p_10 ichartjs_m_10 ichartjs_color ichartjs_inline ichartjs_radius5'><div class='ichartjs_font_600 ichartjs_h_25'>
层次树</div>
<div class='ichartjs_h_18'><span class='ichartjs_h_18'><a href="ichart_element.html" target="main" >iChart.Element</a></span>
</div>
<div class='ichartjs_h_18'><span class='ichartjs_indent'><div class='ichartjs_tree'></div></span><span class='ichartjs_h_18'><a href="ichart_painter.html" target="main" >iChart.Painter</a></span>
</div>
<div class='ichartjs_h_18'><span class='ichartjs_indent'></span><span class='ichartjs_indent'><div class='ichartjs_tree'></div></span><span class='ichartjs_h_18'><a href="ichart_component.html" target="main" >iChart.Component</a></span>
</div>
<div class='ichartjs_h_18'><span class='ichartjs_indent'></span><span class='ichartjs_indent'></span><span class='ichartjs_indent'><div class='ichartjs_tree'></div></span><span class='ichartjs_h_18'><a href="ichart_scale.html" target="main" >iChart.Scale</a></span>
</div>
</div><br/>定义坐标系轴刻度的配置类<br/>
 <br/
</div></div><div class='ichartjs_p_5' id='configs' name='configs'><div class='ichartjs_title ichartjs_p_5'>配置项</div><table class='ichartjs_table'><tr class='ichartjs_table_header'><th class='ichartjs_table_parameter'>参数</th><th class='ichartjs_table_type'>类型</th><th class='ichartjs_table_description'>描述</th><th class='ichartjs_table_definedBy'>定义者</th></tr><tr class='ichartjs_even'><td id='ichart_link_background_color'>background_color</td><td>String</td><td>组件中背景颜色(填充色)的值。(默认为'FEFEFE')<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_basic_value'>basic_value</td><td>Number</td><td>基准坐标值。用于刻度基线不是从0开始的情况下设置。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_border'>border</td><td>Object</td><td>此处设置了开启边框配置项。<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_color_factor'>color_factor</td><td>float(0.01 - 0.5)</td><td>颜色因子，指示其颜色相对于背景色的变化量,值越大，变化值越大(越亮或者越暗)(默认为0.15)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_decimalsnum'>decimalsnum</td><td>Number</td><td>文本的小数点位数。此配置项会随刻度值而变化。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_end_scale'>end_scale</td><td>Number</td><td>结束刻度值。这个值若没有给定，则用max_scale作为结束的刻度值。(默认为undefined)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_fontunit'>fontunit</td><td>String</td><td>此组件中文字的尺寸的单位。(默认为'px')<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_component.html" target="main" >Component</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_gradient'>gradient</td><td>Boolean</td><td>True表示开启渐变效果.(默认为false)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_gradient_mode'>gradient_mode</td><td>String</td><td>背景渐变的样式。(默认为'LinearGradientUpDown')<br/>
 @Option 'LinearGradientUpDown'<br/>
 @Option 'LinearGradientDownUp'<br/>
 @Option 'LinearGradientLeftRight'<br/>
 @Option 'LinearGradientRightLeft'<br/>
 @Option 'RadialGradientOutIn'<br/>
 @Option 'RadialGradientInOut'<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_label'>label</td><td><a href='ichart_text.html'>iChart.Text</a></td><td>标签的配置项。<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_labels'>labels</td><td>Array</td><td>自定义的标签文本。(默认为空数组)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_listeners'>listeners</td><td>Object</td><td>事件的配置项。(默认为null)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_max_scale'>max_scale</td><td>Number</td><td>图表中最大值，一般由数据源决定，不需要给出。(默认为undefined)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_min_scale'>min_scale</td><td>Number</td><td>图表中最小值，一般由数据源决定，不需要给出。(默认为undefined)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_offsetx'>offsetx</td><td>Number</td><td>组件中水平偏移量，正数向右，负数向左。单位像素。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_offsety'>offsety</td><td>Number</td><td>组件中垂直偏移量，正数向下，负数向上。单位像素。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_originx'>originx</td><td>Number</td><td>图表原点x坐标，不指定会根据对齐方式计算。(默认为null)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_originy'>originy</td><td>Number</td><td>图表原点y坐标，不指定会根据对齐方式计算。(默认为null)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_padding'>padding</td><td>Number</td><td>组件中内边框的值,规则与css中的一致，单位像素。(默认为10)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_position'>position</td><td>String</td><td>轴刻度的位置，一般由坐标系给出。(默认为'left')<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_scale2grid'>scale2grid</td><td>Boolean</td><td>当<a href='ichart_coordinate2d.html'>iChart.Coordinate2D</a>配置为true时，指示是否网格与刻度保持一致。(默认为true)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_scale_color'>scale_color</td><td>String</td><td>刻度线的颜色。(默认为4)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_scale_enable'>scale_enable</td><td>Boolean</td><td>是否显示刻度线。(默认为true)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_scale_share'>scale_share</td><td>Number</td><td>刻度的数量。(默认为5)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_scale_size'>scale_size</td><td>Number</td><td>刻度线的粗细。单位px。(默认为1)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_scale_space'>scale_space</td><td>Number</td><td>刻度值的间距值，要小于(最大值-最小值)。(默认为undefined)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_scale_width'>scale_width</td><td>Number</td><td>刻度的长短。单位px。(默认为4)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_scaleAlign'>scaleAlign</td><td>String</td><td>刻度线相对于坐标轴的对齐方式，。(默认为'center')。<br/>
 当配置项which为'h'(水平)时，可选值有：<br/>
 @Option 'left'<br/>
 @Option 'center'<br/>
 @Option 'right' <br/>
 当配置项which为'v'(垂直)时，可选值有：<br/>
 @Option 'top'<br/>
 @Option 'center'<br/>
 @Option 'bottom'<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_shadow'>shadow</td><td>Boolean</td><td>此组件是否启用阴影效果。启用阴影在移动客户端上可能会引起渲染速度变慢。(默认为false)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_shadow_blur'>shadow_blur</td><td>Number</td><td>此组件阴影的模糊程度,单位px。(默认为4)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_shadow_color'>shadow_color</td><td>String</td><td>此组件阴影的颜色值.(默认为'#666666')<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_shadow_offsetx'>shadow_offsetx</td><td>Number</td><td>此组件阴影的x轴偏移量,单位px。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_shadow_offsety'>shadow_offsety</td><td>Number</td><td>此组件阴影的y轴偏移量,单位px。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_start_scale'>start_scale</td><td>Number</td><td>起始刻度值。(默认为0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_strokeStyle'>strokeStyle</td><td>String</td><td>组件中context的strokeStyle属性的值。(默认为'gray')<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_text_space'>text_space</td><td>Number</td><td>文本与坐标轴之间的距离。单位px。(默认为6)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_textAlign'>textAlign</td><td>String</td><td>文本相对于坐标轴的对齐方式。(默认为'left')。<br/>
 当配置项which为'h'(水平)时，可选值有：<br/>
 @Option 'left'<br/>
 @Option 'right' <br/>
 当配置项which为'v'(垂直)时，可选值有：<br/>
 @Option 'top'<br/>
 @Option 'bottom'<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_odd'><td id='ichart_link_which'>which</td><td>String</td><td>轴刻度的方向，一般由坐标系给出。(默认为'h') <br/>
 可选值:<br/>
 @Option 'h' :水平的<br/>
 @Option 'v' :垂直的<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr><tr class='ichartjs_even'><td id='ichart_link_z_index'>z_index</td><td>Number</td><td>组件渲染的顺序，值越大，越靠后渲染，意味着显示在最上层。(默认为 0)<br/></td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr></table></div><div class='ichartjs_p_5' id='events' name='events'><div class='ichartjs_title ichartjs_p_5'>事件</div><table class='ichartjs_table'><tr class='ichartjs_table_header'><th class='ichartjs_table_parameter'>名称</th><th class='ichartjs_table_description'>描述</th><th class='ichartjs_table_definedBy'>定义者</th></tr><tr class='ichartjs_even'><td>beforedraw</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>绘图之前触发，返回false停止绘图行为。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td>click</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>点击时触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
<li>e&nbsp;:&nbsp;EventObject&nbsp;&nbsp; 鼠标事件对象</li>
<li>param&nbsp;:&nbsp;Object&nbsp;&nbsp; 额外的参数</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td>draw</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>完成绘图之后触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td>initialize</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>初始化完成之后触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_element.html" target="main" >Element</a></td></tr><tr class='ichartjs_even'><td>mousemove</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>鼠标移动时触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
<li>e&nbsp;:&nbsp;EventObject&nbsp;&nbsp; 鼠标事件对象</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td>mouseout</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>鼠标在离开时触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
<li>e&nbsp;:&nbsp;EventObject&nbsp;&nbsp; 鼠标事件对象</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_even'><td>mouseover</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>鼠标在进入时触发。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>this&nbsp;:&nbsp;Scale&nbsp;&nbsp;</li>
<li>e&nbsp;:&nbsp;EventObject&nbsp;&nbsp; 鼠标事件对象</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td>parseText</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>解析轴文本时候触发，返回值将会覆盖当前值。例如:{text:'',originx:100,originy:100}<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>text&nbsp;:&nbsp;string&nbsp;&nbsp; 文本</li>
<li>originx&nbsp;:&nbsp;int&nbsp;&nbsp; x轴坐标</li>
<li>originy&nbsp;:&nbsp;int&nbsp;&nbsp; y轴坐标</li>
<li>index&nbsp;:&nbsp;int&nbsp;&nbsp; 索引</li>
<li>last&nbsp;:&nbsp;boolean&nbsp;&nbsp; 是否是最后一项</li>
</ul></div></div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_scale.html" target="main" >Scale</a></td></tr></table></div><div class='ichartjs_p_5' id='methods' name='methods'><div class='ichartjs_title ichartjs_p_5'>方法</div><table class='ichartjs_table'><tr class='ichartjs_table_header'><th class='ichartjs_table_parameter'>名称</th><th class='ichartjs_table_description'>描述</th><th class='ichartjs_table_definedBy'>定义者</th></tr><tr class='ichartjs_even'><td>draw</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>绘图方法接口，这是一个抽象模板方法。实现此方法之后定义自己的行为。目前为止,<a href='ichart_chart.html'>iChart.Chart</a> 和 <a href='ichart_component.html'>iChart.Component</a> 实现了此方法.<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>无<br/></li>
</ul></div>
<div class='ichartjs_stress'>返回值<br/></div>
<div class='ichartjs_pl_10'>&nbsp;&nbsp;void</div>
</div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_painter.html" target="main" >Painter</a></td></tr><tr class='ichartjs_odd'><td>getDimension</td><td><div class='ichartjs_h_25 ichartjs_pl_10'>获取当前组件的尺寸。返回对象包含以下属性：<br/>
	 * @property x:左上方x轴坐标<br/>
	 * @property y:左上方y轴坐标<br/>
	 * @property width:宽度，单位:px。<br/>
	 * @property height:高度，单位:px。<br/></div>
<div class='ichartjs_h_25 ichartjs_pl_10'><div class='ichartjs_stress'>参数<br/></div>
<div class='ichartjs_pl_10'><ul><li>无<br/></li>
</ul></div>
<div class='ichartjs_stress'>返回值<br/></div>
<div class='ichartjs_pl_10'>&nbsp;&nbsp;object</div>
</div>
</td><td class='ichartjs_right ichartjs_stress'><a href="ichart_component.html" target="main" >Component</a></td></tr></table></div><div class='ichartjs_reference'><strong>参考:</strong><span class='ichartjs_reference_item'><a href="ichart_component.html" target="main" >Component</a></span></div>
</body>
</html>